import { axios } from '@/utils/request.js';

// get请求
export function getAction(url, params, option) {
	return axios({
		url: url,
		method: 'get',
		params: params,
		...option
	});
}
// post请求
export function postAction(url, params, option) {
	return axios({
		url: url,
		method: 'post',
		data: params,
		...option
	});
}
// put请求
export function putAction(url, params, option) {
	return axios({
		url: url,
		method: 'put',
		data: params,
		...option
	});
}
// deleteParams请求
export function deleteAction(url, parameter, option) {
	return axios({
		url: url,
		method: 'delete',
		params: parameter,
		...option
	});
}
// deleteParams请求
export function deleteObjAction(url, data) {
	return axios({
		url: url,
		method: 'delete',
		data,
	});
}
// 下载文件 用于excel导出，get方法
export function downFile(url, parameter) {
	return axios({
		url: url,
		params: parameter,
		method: 'get',
		responseType: 'blob',
	});
}
// 下载文件 用于excel导出,post方法
export function downFilePost(url, data) {
	return axios({
		url: url,
		data,
		method: 'post',
		responseType: 'blob',
	});
}
